﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Demonstartor
{
    class Normalizer
    {
        public static void Normalize(Dictionary<InvolvedParameter, DateTimeValuesList> Values)
        {
            bool NormDensity = false;
            double MinDensity = 0, MaxDensity = 1;
            foreach (var v in Values)
            {
                double Max = v.Value.Max(vv => vv.Max());
                double Min = v.Value.Min(vv => vv.Min());
                double Coeff = 1 / (Max - Min);

                if (v.Key.Name == "Оценка")
                {
                    MaxDensity = Max;
                    MinDensity = Min;
                    NormDensity = true;
                }

                if (v.Key.Name == "Граница")
                {
                    Max = MaxDensity;
                    Min = MinDensity;
                    Coeff = 1 / (Max - Min);
                }

                int VCount = v.Value.Count;
                    for (int i = 0; i < VCount; i++)
                    {
                        v.Value[i].Normalize(Min, Max);
                    }
                

            }
        }
    }
}
